package simulation.CreatorPackage;

import java.util.Scanner;

import simulation.ConstantForceWallRepulsion;
import simulation.Factory;
import simulation.InverseSquareForceWallRepulsion;
import simulation.Model;

public class wallRepulsionCreator extends Creator {
	private final Factory myFactory;

	public wallRepulsionCreator(Factory factory) {
		myFactory=factory;
	}

	@Override
	public void createObjectInModel(Scanner line, Model model) {
		int id=line.nextInt();
    	double magnitude=line.nextDouble();
    	double expo=line.nextDouble();
    	if (expo==2.0){
    		model.add(new InverseSquareForceWallRepulsion(magnitude,id,myFactory.getView().getSize()));
    	}
    	model.add(new ConstantForceWallRepulsion(magnitude,id));
		// TODO Auto-generated method stub

	}

}
